


		
project, uses(../data_output/termlimited.dta)

	*** variables: sponsored, log sponsor, committees, vice chairs, leader
	***			   floor votes, cvp, vote with party
	
	
	use ../data_output/termlimited.dta, clear

	local i = 0

	
	foreach v in pct_floorvotes sponsored cmt_index  {
	
		local ++i
		reghdfe `v' termlimited  , absorb(CandId  chamber_term )  cluster(CandId) keepsingletons 
		local r`i' = _b[termlimited]
		local se`i' = _se[termlimited]
		local n`i' = e(N)
		local l`i' = e(N_clust)
		qui sum `v' if e(sample)
		local m`i' =  r(mean)
		local sd`i' = r(sd)		
		
		
		local ++i	
		reghdfe `v' termlimited  , absorb(CandId chamber_party_term ) cluster(CandId)  keepsingletons
		local r`i' = _b[termlimited]
		local se`i' = _se[termlimited]
		local n`i' = e(N)
		local l`i' = e(N_clust)
		qui sum `v' if e(sample)
		local m`i' =  r(mean)
		local sd`i' = r(sd)		
		
		
	
	}
	


	
	cap log close
	quietly {
	
		set linesize 255
		log using "../tables_figures/productivity_components.tex", text replace
		
		

		noisily dis "\begin{table}[t]"
		noisily dis "\centering"
		noisily dis "\caption{\textbf{Effect of Electoral Incentives on Bill Sponsorship, Committee Activity, and Attendance.}"
		noisily dis "In their final term, term-limited legislators are less productive. \label{tab:productivity_components}} "
		*noisily dis "\begin{adjustbox}{width=\textwidth}"		
		noisily dis "\begin{tabular}{l cc cc cc}"
		noisily dis "\toprule\toprule \\[2mm] "
		
		noisily dis "& \multicolumn{2}{c}{Pct }  & \multicolumn{2}{c}{Sponsored  } & \multicolumn{2}{c}{Committee }  \\"
		noisily dis "& \multicolumn{2}{c}{ Floor Votes }  & \multicolumn{2}{c}{ Bills } & \multicolumn{2}{c}{ Activity}  \\"		
		
		noisily dis	" \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}  \\ "
		noisily dis "& (1) & (2) & (3) & (4) & (5) & (6)   \\[1mm]"
		noisily dis "\midrule"
		noisily dis " Term Limited  & " %4.2f `r1' " & " %4.2f `r2' " & " %4.2f `r3' "& " %4.2f `r4' " & " %4.2f `r5' " & " %4.2f `r6'    "\\"
		noisily dis "  				& (" %4.2f `se1' ") & (" %4.2f `se2' ") & (" %4.2f `se3' ") & (" %4.2f `se4' ") & (" %4.2f `se5' ") & (" %4.2f `se6' ")   \\[1mm]"
		
		
		
		
		noisily dis "\midrule "
		noisily dis " N & " %8.0fc `n1' " & " %8.0fc `n2' " & " %8.0fc `n3'  "& " %8.0fc `n4' " & " %8.0fc `n5' " & " %8.0fc `n6'  "\\"
		noisily dis " Legislators & " %8.0fc `l1' " & " %8.0fc `l2' " & " %8.0fc `l3'   "  & " %8.0fc `l4' " & " %8.0fc `l5' " & " %8.0fc `l6'  " \\"
		noisily dis " Outcome Mean  & " %4.2f `m1' " & " %4.2f `m2' " & " %4.2f `m3'  "& " %4.2f `m4' " & " %4.2f `m5' " & " %4.2f `m6'    "\\"
		noisily dis " Standard Dev.  & " %4.2f `sd1' " & " %4.2f `sd2' " & " %4.2f `sd3' "& " %4.2f `sd4' " & " %4.2f `sd5' " & " %4.2f `sd6'     "\\"

		noisily dis "Legislator FE        		 & Yes  & Yes & Yes  & Yes  & Yes & Yes     \\"
		noisily dis "Chamber-Year FE 	  		 & Yes  &     &  Yes &   &  Yes   &  	  \\"
		noisily dis "Chamber-Party-Year FE 	  	 &      & Yes & 	  &   Yes   &  & 	Yes	  \\"

		noisily dis "\bottomrule \bottomrule\\[-4mm]"
		noisily dis "\multicolumn{7}{p{.8\textwidth}}{\footnotesize "
		noisily dis " In column 1 the outcome variable is the log of the number of sponsored bills, plus one."
		noisily dis " In column 2 the outcome variable is an index of committee activity."
		noisily dis " In column 3 the outcome is the percentage of roll-call votes the legislator is present for and votes on."
		noisily dis " In column 4 the outcome variable is the first principal component from a PCA of the three measures of effort."
		noisily dis "The unit of observation is a legislator. The variable Term Limited is a dummy variable indicating if a legislator is in her final, term-limited term."
		noisily dis "Dataset covers the 14 state legislative chambers with term limits"
		noisily dis " of three terms or longer, and covers legislative terms following elections from 1984-2014. "
		noisily dis "Robust standard clustered by legislator in parentheses.}"
		noisily dis "\end{tabular}"
		*noisily dis "\end{adjustbox}"
		noisily dis "\end{table}"

		
		log off
	
	}
		